<?php

declare(strict_types=1);

namespace app\yperp\command;

use app\yperp\common\ChanghongList;
use app\yperp\common\MyWebDriver;
use app\yperp\common\Redis;
use app\yperp\model\Supplier;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\Output;
use think\Queue;

class mgtstatus extends Command
{
      protected $output;

    protected $input;
    protected $driver;
    protected $windows = [];
    protected $cookies = [];
    protected function configure()
    {
        // 指令配置
        $this->setName('mgtstatus')
            ->addArgument('id', Argument::OPTIONAL, "商品ID")
            ->addArgument('status', Argument::OPTIONAL, "设置状态")
            ->setDescription('商品数据状态修改');
    }

    protected function execute(Input $input, Output $output)
    {
        // 指令输出
        $this->input = $input;

        $this->output = $output;

        $id = $this->input->getArgument('id');
        $status = $this->input->getArgument('status');

        if ($id && $status) {
            Supplier::status($id, $status);
        }
        $output->writeln('ok');
    }
}
